"use strict";
//基本类型
var num;
num = 123;
var str;
str = "123";
var boolean;
boolean = false;
var undefine;
undefine = undefined;
var nul;
nul = null;
//其它类型
//类型推断 联合类型
var data;
var anything;
anything = 1;
// var num12: number;
// num12 = null;
data = 123;
data = "123";
var data2;
data2 = "123";
var nosure = 123; //number
// nosure = "asd"; //报错，因为上面的类型推断
var arr;
// arr = ["123", 1, 1, 2];
var arr1;
arr1 = ["1", "2", "3", "..."];
//type[] 这里是[整体上]是什么类型
// 方案二 数组
var arr2;
// arr2 = [1, 2, "32"];
//Array<type>
var arr3;
arr3 = [false, true];
// 对象约束
var obj = { name: "wxs", age: 10 };
var user1 = {
    name: "imycode",
    age: 0,
    gender: "male",
    address: "fujian fuzhou",
};
//
// console.log(num + " " + str + " " + boolean + " " + undefine + " " + nul);
/* 函数类型 */
var a = function (params) {
    return params;
};
console.log(a(1));
function add(a, b) {
    console.log("a+b=" + (a + b));
}
add(100, 1000);
